package function;

import common.PostJson;
import net.sf.json.JSONObject;

public class LoginAction {
	private static String GET_VERICODE_URL = "http://106.15.43.138:8080/api/user/v_code";
	private static String LOGIN_URL = "http://106.15.43.138:8080/api/user/smslogin";
	private static String GET_TOKEN = "http://106.15.43.138:8080/api/user/token";
	private static String GET_DETAIL = "http://106.15.43.138:8080/api/user/getinfo";

	// 获取验证码√
	public static String getVericode(JSONObject json) {
		json.put("channel_id", "BBX");
		json.put("app", "0");
		json.put("app_version", "2.0");
		String aJson = PostJson.postJson(json, GET_VERICODE_URL);
		return aJson;
	}

	// 登录√
	public static String login(JSONObject json) {
		json.put("imei", "xxx");
		json.put("type", "0");
		json.put("origin_type", "2");
		json.put("app", "0");
		String aJson = PostJson.postJson(json, LOGIN_URL);
		return aJson;
	}

	// 获取Token
	public static String token(JSONObject json) {
		String aJson = PostJson.postJson(json, GET_TOKEN);
		return aJson;
	}

	public static String detail(JSONObject json) {
		String aJson = PostJson.postJson(json, GET_DETAIL);
		return aJson;
	}
}